package main

import "fmt"

type user struct {
	name     string
	password string
}

type student struct {
	name string
	age  int
}

func (u student) checkAge(age int) bool {
	return u.age >= age
}
func (u *student) resetName(name string) {
	u.name = name
}

func (u user) checkPassword(password string) bool {
	return u.password == password
}

func (u *user) resetPassword(password string) {
	u.password = password
}

func main() {
	a := user{name: "wang", password: "1024"}
	a.resetPassword("2048")
	fmt.Println(a.checkPassword("2048")) // true

	fmt.Println("-----")
	student := student{name: "wang", age: 23}
	student.checkAge(23)
	fmt.Println(student.checkAge(2323))
	fmt.Println(student)
	student.resetName("cj")
	fmt.Println(student)
}
